<template>
  <div id="box">
    <van-nav-bar title="详情页" left-text="返回" left-arrow @click-left="onClickLeft" />
    <ShoppingTop />
    <div class="box">
      <ShoppingLeft :list="list" :i="i" @onup="fun" />

      <ShoppingRight :list="list" :i="i" />
    </div>
  </div>
</template>

<script>
import { baobao_list } from "../axios/api";
import { Toast } from 'vant';
import ShoppingTop from "@/components/ShoppingTop.vue";
import ShoppingLeft from "@/components/ShoppingLeft.vue";
import ShoppingRight from "@/components/ShoppingRight.vue";
export default {
  components: {
    ShoppingTop,
    ShoppingLeft,
    ShoppingRight,
  },
  mounted() {
    baobao_list({ status: 0 }).then(
      response => {
        console.log(response.data);
        this.list = response.data.list
        Toast.success('已到达详情页')
      }
    )
  },
  data() {
    return {
      i: 0,
      list: []
    };
  },
  methods: {
    fun(index) {
      this.i = index;
    },
    onClickLeft() {
      Toast.success('返回上一页面');
      this.$router.go(-1)
    },

  },
};
</script>

<style lang="scss"  >
* {
  margin: 0;
  padding: 0;
}
#box {
  width: 100%;
  height: 100%;
  //   background-color: pink;
  //
  > .box {
    height: 100%;
    width: 100%;
    display: flex;
  }
}
</style>